package day230319;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/3/19 21:11
 */
@SuppressWarnings({"all"})
public class Main12 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(); // 表示小组总数
        int[] level = new int[3*n]; // 存储队员的水平值
        for (int i = 0; i < level.length; i++) {
            level[i] = in.nextInt();
        }
        Arrays.sort(level);
        // 记录结果
        long retSum = 0L;
        for (int i = 0; i < n; i++) {
            retSum += level[level.length - 2*(i+1)];
        }
        System.out.println(retSum);
        in.close();
    }
}
